package ru.spb.osll.myfit.fixtures;

import org.apache.log4j.Logger;

import ru.spb.osll.myfit.fixtures.base.OneLineFixture;
import ru.spb.osll.myfit.util.logger.MyFitLogger;

public class WriteClipsFixture extends OneLineFixture {
	private Logger log = Logger.getLogger(WriteClipsFixture.class);
	private float del;
	public boolean writeClipsSizeBytes(long clipscount, long clipSize){
		del = clipSize > 1024 ? 2f : 1f;
		log.info(String.format("Writer: clips=%d, rate=%s, clipsize=%d", 0, 0.0, clipSize));			
		
		for(long i = 1; i < clipscount; i = i + 3){
			log.info(String.format("Writer: clips=%d, rate=%s, clipsize=%d", i, getRate(i), clipSize));			
		}
		return true;
	}
	
	private float getRate(long i){
		int dr = (int) (i % 5);
		return (10f + dr/10f)/del;
	}
	
	public static String[] getTestTableTemplates() {
	    return new String[]{"|write clips||size||bytes|"};
	}
}
